import java.util.Arrays;
import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        int[] arr = {9,5,2,4,6,3,8,7,1};
        Arrays.sort(arr);
        Scanner sc = new Scanner(System.in);
        int target = sc.nextInt();
        int left = 0;
        int right = arr.length - 1;
        int mid = 0;
        while(left < right) {
            mid = left + ((right - left) >> 1);
            if(arr[mid] > target) {
                right = mid - 1;
            }else if(arr[mid] < target) {
                left = mid + 1;
            }else {
                System.out.println(arr[mid]);
                break;
            }
        }
        if(left > right) {
            System.out.println("没找到！");
        }
    }
    public static void main7(String[] args) {
        int[] arr = {9,5,2,4,6,3,8,7,1};
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if(arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
        }
        for(int x : arr) {
            System.out.print(x + " ");
        }
    }
    public static void main6(String[] args) {
        int[] arr = {1,5,8,9,7,2};
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] % 2 != 0) {
                count++;
            }else {
                count = 0;
            }
        }
        if(count == 3) {
            System.out.println(true);
        }else {
            System.out.println(false);
        }
    }
    public static void main5(String[] args) {
        int[] arr = {1,2,2,1,1,2,1,2,2};
        Arrays.sort(arr);
        System.out.println(arr[arr.length / 2]);
    }
    public static void main4(String[] args) {
        int[] arr = {1,1,2,2,3};
        int end = 0;
        for(int x : arr) {
            end ^= x;
        }
        System.out.println(end);
    }
    public static void main3(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        Scanner sc = new Scanner(System.in);
        int target = sc.nextInt();
        Find(arr,target);
    }
    public static void Find(int[] arr, int target) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if(arr[i] + arr[j] == target) {
                    System.out.println("[" + i + "," + j + "]");
                    break;
                }
            }
        }
    }
    public static void main2(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        arr = Exchange(arr);
        for(int x : arr) {
            System.out.print(x + " ");
        }
    }
    public static int[] Exchange(int[] arr) {
        int i = 0;
        int j = arr.length - 1;
        while(i < j) {
            if(arr[i] % 2 == 0) {
                if(arr[j] % 2 != 0) {
                    int tmp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = tmp;
                }else {
                    j--;
                }
            }else {
                i++;
            }
        }
        return arr;
    }

    public static void main1(String[] args) {
        //Scanner sc = new Scanner(System.in);
        int[] arr = new int[]{1,2,3};
        arr = Transform(arr);
        for(int x : arr) {
            System.out.print(x);
        }

    }
    public static int[] Transform(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] *= 2;
        }
        return array;
    }
}
